<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page language="java" contentType="text/html; charset=UTF-8"%>
<%@ page import="model.action.basic_function_action.recaptcha.ReCaptcha"%>
<%@ page
	import="model.action.basic_function_action.recaptcha.ReCaptchaFactory"%>

<%@ taglib prefix="s" uri="/struts-tags"%>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><s:property value="getText('title.dangnhap')"/></title>
<link href="<s:url value="/view/common_view/css/style.css"/>" rel="stylesheet" type="text/css" />
<link href="<s:url value="/view/common_view/css/bootstrap.css"/>" rel="stylesheet" type="text/css" />
<link href="<s:url value="view/common_view/css/bootstrap.min.css"/>" rel="stylesheet" type="text/css" />

<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.2/themes/smoothness/jquery-ui.css" />
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/ui/1.10.2/jquery-ui.js"></script>
<link rel="stylesheet" href="/resources/demos/style.css" />
<script>
 $(function() {
   $( document ).tooltip({
     position: {
       my: "center bottom-12",
       at: "center top",
       using: function( position, feedback ) {
         $( this ).css( position );
         $( "<div>" )
           .addClass( "arrow" )
           .addClass( feedback.vertical )
           .addClass( feedback.horizontal )
           .appendTo( this );
       }
     }
   });
 });
</script>
	

</head>

<body>
	<center>
		<div id="loginbanner"></div>
	</center>
	<div class="combobox">
	<div id="language">
			<form action="" id="languageForm">
				<script type="text/javascript">
					var urlTemp = document.URL;
					var urlLang = urlTemp;
					var position1 = urlTemp.indexOf("?request_locale");
					var position2 = urlTemp.indexOf("&request_locale");

					if(position1 == -1 && position2 == -1) {
						position1 = urlTemp.indexOf("?");
						if(position1 == -1){
							urlLang = urlTemp+"?request_locale";
						}
						else{
							urlLang = urlTemp+"&request_locale";
						}
					}
					else {
						if(position1 > -1){
							urlLang = urlTemp.substr(0,position1)+"?request_locale";
						}
						if(position2 > -1){
							urlLang = urlTemp.substr(0,position2)+"&request_locale";
						}
					}
					document.write('<a href="'+urlLang+'=vi" title="Nhấn để chọn ngôn ngữ tiếng Việt">');			
					document.write('<div class="dd-vietnamese"></div>');
					document.write('</a>');
					
					document.write('<a href="'+urlLang+'=en" title="Nhấn để chọn ngôn ngữ tiếng Anh">');
					document.write('<div class="dd-english"></div>');
					document.write('</a>');
				</script>
			</form>
		</div>
		</div>
		<!--login form-->
		<div id="login">
			<s:form id="frmlogin" method="post" action="login_action">
				
				<fieldset>
					<legend>
					<div id="panelHeader">
						<s:property value="getText('title.dangnhap')"/>
					</div>
					</legend>
					<!-- place message display -->
				<div id="thongbao1" style="color: red">
					<s:iterator value="arrErrorMessage" status="stt">
						<s:property value="arrErrorMessage.get(#stt.index)" />
						<br />
					</s:iterator>
				</div>
				<hr />
				
				<div id="logincontent">
					<!--==================================================================== LABEL-->
						<div id="label" class="login-text">
							<div>
								<label class="tendangnhap" for="tendangnhap"><s:property value="getText('label.tendangnhap')"/> :</label>
							</div>
							
							<div>
								<label class="cm-password" for="password1"><s:property value="getText('label.cm-password1')"/> :</label>
							</div>
							
							<div>
								<label class="forgotPassword" for="forgotPassword"></label>
							</div>
							
							<s:set name="failCount" value="%{failCount}" />
							<s:if test="%{#failCount > 4}">
								<div>
									<label class="captcha" for="captcha"><s:property value="getText('label.captcha')"/> :</label>
								</div>
							</s:if>
						</div>
					<!--==================================================================== TEXTBOX-->
						<div id="textbox" class="login-text">
							<div>
								<s:textfield id="tendangnhap" class="tendangnhap" type="text" value="" name="userID" size="50" 
								title="Nhập tên tài khoản chỉ bao gồm các kí tự a-zA-Z0-9. Độ dài từ 6- 25 kí tự"/>
							</div>
							
							<div>
								<s:password id="login-password" class="cm-password" type="password" datatype="require" 
								require="true" name="passWord" size="50" title="Nhập mật khẩu có độ dài tối đa 6-50 kí tự" />
							</div>
							
							<div>
								<a href="retrieve-password.html" title="Nhấn để đăng kí lại mật khẩu"><s:property value="getText('link.quenmatkhau')"/></a>
								<a>/</a>
								<a href="register-type.html" title="Nhấn để đăng kí tài khoản"><s:property value="getText('link.dangkytaikhoan')"/></a>
							</div>
							
							<s:set name="failCount" value="%{failCount}" />
							<s:if test="%{#failCount > 4}">
								<!--HINH CAPTCHA-->
								<div id="recaptcha" class="captch">
									<%
										ReCaptcha c = ReCaptchaFactory.newReCaptcha(
														"6Lf4W98SAAAAAID1nMaf25I9NoXBP1Uf7VfahP1M",
														"6Lf4W98SAAAAAHfcJzLW6bf3oINtbE12J1jwIpXD", false);
												out.print(c.createRecaptchaHtml(null, null));
									%>
								</div>
							</s:if>
						</div>
					</div>
					
					<!--==================================================================== BUTTON-->
					<div id="button_login" class="button_login">
						<div class="childbbutton_login">
							<%-- <s:submit id="Huy" class="formbutton" type="reset" value="Hủy"
								action="home" /> --%>
								<a class="btn btn-warning" href="home.html" title="Nhấn để quay về trang chủ"><s:property value="getText('button.huy')"/></a>
						</div>
						
						<div class="childbutton_login">
							<%-- <s:submit id="Dongy" class="formbutton" type="submit"
								value="Đồng ý" /> --%>
								<button class="btn btn-success" type="submit" title="Nhấn để đăng nhập vào trang chủ"><s:property value="getText('button.dangnhap')"/></button>
						</div>
					</div>
				</fieldset>
			</s:form>
		</div>
		<!--end the form-->
	<center>
		<!-- FOOTER -->
		<div id="loginfooter">
			<div id="footerinfoextra">
					<label><strong><s:property value="getText('label.congty')"/></strong></label><br/>
					<label><s:property value="getText('label.diachicty')"/></label><br/>
					<label><s:property value="getText('label.vanphong')"/></label><br/>
					<label>Hotline : 08 12 345 678 – 098 123 4567</label><br/>
					<label>Email: cungdeal@gmail.com</label><br/>
			</div>
		</div>
		<div id="messagefooter">
			Copyright by SOL Team. All Rights Reserved.
		</div>
		<!-- FOOTER -->
	</center>
</body>
</html>